/* 响应式设计和移动端适配 */

/* 大屏幕设备 (1200px 及以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* 中等屏幕设备 (992px 到 1199.98px) */
@media (max-width: 1199.98px) {
    .product-card {
        margin-bottom: 20px;
    }
    
    .category-card {
        margin-bottom: 20px;
    }
}

/* 平板设备 (768px 到 991.98px) */
@media (max-width: 991.98px) {
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 8px 0;
    }
    
    .search-form {
        margin-top: 15px;
    }
    
    .cart-icon {
        margin-top: 15px;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .product-card {
        margin-bottom: 20px;
    }
    
    .category-card {
        margin-bottom: 20px;
    }
    
    .footer-links {
        margin-bottom: 30px;
    }
    
    .profile-sidebar {
        margin-bottom: 30px;
    }
    
    .order-item {
        width: 100%;
    }
}

/* 手机设备 (576px 到 767.98px) */
@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .btn-hero {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .product-card {
        margin-bottom: 20px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-title {
        font-size: 0.9rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .category-card {
        margin-bottom: 20px;
    }
    
    .category-title {
        font-size: 1rem;
    }
    
    .footer {
        text-align: center;
    }
    
    .footer-links {
        margin-bottom: 20px;
    }
    
    .footer-links h5 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .footer-links ul {
        padding-left: 0;
        list-style: none;
    }
    
    .footer-links ul li {
        margin-bottom: 5px;
    }
    
    .social-icons {
        justify-content: center;
        margin-top: 20px;
    }
    
    .cart-item {
        padding: 15px;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    .cart-item-info {
        font-size: 0.9rem;
    }
    
    .cart-item-price {
        font-size: 1rem;
    }
    
    .cart-item-quantity {
        width: 100px;
    }
    
    .cart-summary {
        margin-top: 20px;
    }
    
    .profile-sidebar {
        margin-bottom: 30px;
    }
    
    .profile-sidebar .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .order-item {
        width: 100%;
        padding: 10px;
    }
    
    .order-item img {
        width: 50px;
        height: 50px;
    }
    
    .order-item-name {
        font-size: 0.9rem;
    }
    
    .order-item-spec {
        font-size: 0.8rem;
    }
    
    .order-item-price {
        font-size: 0.9rem;
    }
    
    .order-item-quantity {
        font-size: 0.8rem;
    }
    
    .order-total {
        font-size: 0.9rem;
    }
    
    .order-actions {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .order-actions .btn {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .address-card {
        padding: 10px;
    }
    
    .address-info h5 {
        font-size: 1rem;
    }
    
    .address-info p {
        font-size: 0.9rem;
    }
    
    .address-actions {
        margin-top: 10px;
    }
    
    .address-actions .btn {
        font-size: 0.8rem;
        padding: 5px 10px;
        margin-right: 5px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 15px;
    }
}

/* 小型手机设备 (575.98px 及以下) */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .btn-hero {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .product-card {
        margin-bottom: 15px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-title {
        font-size: 0.8rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .category-card {
        margin-bottom: 15px;
    }
    
    .category-title {
        font-size: 0.9rem;
    }
    
    .cart-item {
        padding: 10px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-info {
        font-size: 0.8rem;
    }
    
    .cart-item-price {
        font-size: 0.9rem;
    }
    
    .cart-item-quantity {
        width: 80px;
    }
    
    .order-item {
        padding: 8px;
    }
    
    .order-item img {
        width: 40px;
        height: 40px;
    }
    
    .order-item-name {
        font-size: 0.8rem;
    }
    
    .order-item-spec {
        font-size: 0.7rem;
    }
    
    .order-item-price {
        font-size: 0.8rem;
    }
    
    .order-item-quantity {
        font-size: 0.7rem;
    }
    
    .order-total {
        font-size: 0.8rem;
    }
    
    .order-actions .btn {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .address-card {
        padding: 8px;
    }
    
    .address-info h5 {
        font-size: 0.9rem;
    }
    
    .address-info p {
        font-size: 0.8rem;
    }
    
    .address-actions .btn {
        font-size: 0.7rem;
        padding: 4px 8px;
        margin-right: 3px;
    }
}

/* 横屏模式适配 */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .product-image {
        height: 150px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .product-card, .category-card {
        min-height: 44px;
        min-width: 44px;
    }
    
    .cart-item-quantity input {
        min-height: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image img, .cart-item-image img, .order-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}